package com.nickstumpos.android.GmailWidgetPlus.widget.presentation.managers;

import java.util.List;

import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;

import com.nickstumpos.android.GmailWidgetPlus.widget.sizes.WidgetSize;
import com.nickstumpos.android.GmailWidgetPlus.widget.skins.WidgetSkins;

public class WidgetUIData {

	public static boolean isIntentAvailable(final Context context,
			final String action) {

		final PackageManager packageManager = context.getPackageManager();

		final Intent intent = new Intent(action);

		final List<ResolveInfo> list =

		packageManager.queryIntentActivities(intent,

		PackageManager.MATCH_DEFAULT_ONLY);

		return list.size() > 0;

	}

	private int			widgetId;
	private WidgetSkins	skin;
	private WidgetSize	size;
	private int			upButton;
	private int			downButton;
	private int			upButtonDisabled;
	private int			downButtonDisabled;
	private int			unreadCountButton;
	private int			noUnreadMailText;
	private int			noUnreadMailButton;

	private String		account;

	/**
	 * @param widgetId
	 * @param type
	 * @param account
	 * @param size
	 * @param upButton
	 * @param downButton
	 */
	public WidgetUIData(final int widgetId,
			final WidgetSkins skin,
			final String account,
			final WidgetSize size,
			final int upButton,
			final int downButton,
			final int downButtonDisabled,
			final int upButtonDisabled,
			final int unreadCountButton,
			final int noUnreadMailText,
			final int noUnreadMailButton) {

		super();
		this.account = account;
		this.widgetId = widgetId;
		this.skin = skin;
		this.size = size;
		this.upButton = upButton;
		this.downButton = downButton;
		this.upButtonDisabled = upButtonDisabled;
		this.downButtonDisabled = downButtonDisabled;
		this.unreadCountButton = unreadCountButton;
		this.noUnreadMailButton = noUnreadMailButton;
		this.noUnreadMailText = noUnreadMailText;
	}

	public String getAccount() {

		return this.account;
	}

	/**
	 * @return the downButton
	 */
	public int getDownButton() {

		return this.downButton;
	}

	public int getDownButtonDisabled() {

		return this.downButtonDisabled;
	}

	public int getNoUnreadMailButton() {

		return this.noUnreadMailButton;
	}

	public int getNoUnreadMailText() {

		return this.noUnreadMailText;
	}

	/**
	 * @return the size
	 */
	public WidgetSize getSize() {

		return this.size;
	}

	/**
	 * @return the type
	 */
	public WidgetSkins getSkin() {

		return this.skin;
	}

	/**
	 * @return the unreadCountButton
	 */
	public int getUnreadCountButton() {

		return this.unreadCountButton;
	}

	/**
	 * @return the upButton
	 */
	public int getUpButton() {

		return this.upButton;
	}

	public int getUpButtonDisabled() {

		return this.upButtonDisabled;
	}

	/**
	 * @return the widgetId
	 */
	public int getWidgetId() {

		return this.widgetId;
	}

	/**
	 * @param account2
	 */
	public void setAccount(final String account) {

		this.account = account;
	}

	/**
	 * @param downButton
	 *            the downButton to set
	 */
	public void setDownButton(final int downButton) {

		this.downButton = downButton;
	}

	/**
	 * @param downButtonDisabled
	 *            the downButtonDisabled to set
	 */
	public void setDownButtonDisabled(final int downButtonDisabled) {

		this.downButtonDisabled = downButtonDisabled;
	}

	/**
	 * @param noUnreadMailButton
	 *            the noUnreadMailButton to set
	 */
	public void setNoUnreadMailButton(final int noUnreadMailButton) {

		this.noUnreadMailButton = noUnreadMailButton;
	}

	/**
	 * @param noUnreadMailText
	 *            the noUnreadMailText to set
	 */
	public void setNoUnreadMailText(final int noUnreadMailText) {

		this.noUnreadMailText = noUnreadMailText;
	}

	/**
	 * @param size
	 *            the size to set
	 */
	public void setSize(final WidgetSize size) {

		this.size = size;
	}

	/**
	 * @param skin
	 *            the skin to set
	 */
	public void setSkin(final WidgetSkins skin) {

		this.skin = skin;
	}

	/**
	 * @param unreadCountButton
	 *            the unreadCountButton to set
	 */
	public void setUnreadCountButton(final int unreadCountButton) {

		this.unreadCountButton = unreadCountButton;
	}

	/**
	 * @param upButton
	 *            the upButton to set
	 */
	public void setUpButton(final int upButton) {

		this.upButton = upButton;
	}

	/**
	 * @param upButtonDisabled
	 *            the upButtonDisabled to set
	 */
	public void setUpButtonDisabled(final int upButtonDisabled) {

		this.upButtonDisabled = upButtonDisabled;
	}

	/**
	 * @param widgetId
	 *            the widgetId to set
	 */
	public void setWidgetId(final int widgetId) {

		this.widgetId = widgetId;
	}
}
